<?php

/**
 * This is the model class for table "dosenpt".
 *
 * The followings are the available columns in table 'dosenpt':
 * @property integer $dpt_id
 * @property string $dpt_pt
 * @property integer $dpt_tetap_laki
 * @property integer $dpt_tetap_perm
 * @property integer $dpt_nontetap_laki
 * @property integer $dpt_nontetap_perm
 * @property integer $dpt_jml_laki
 * @property integer $dpt_jml_perm
 * @property integer $dpt_tahun
 */
class Dosenpt extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Dosenpt the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'dosenpt';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('dpt_tetap_laki, dpt_tetap_perm, dpt_nontetap_laki, dpt_nontetap_perm, dpt_jml_laki, dpt_jml_perm, dpt_tahun', 'numerical', 'integerOnly'=>true),
			array('dpt_pt', 'length', 'max'=>128),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('dpt_id, dpt_pt, dpt_tetap_laki, dpt_tetap_perm, dpt_nontetap_laki, dpt_nontetap_perm, dpt_jml_laki, dpt_jml_perm, dpt_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'dpt_id' => 'Dpt',
			'dpt_pt' => 'Dpt Pt',
			'dpt_tetap_laki' => 'Dpt Tetap Laki',
			'dpt_tetap_perm' => 'Dpt Tetap Perm',
			'dpt_nontetap_laki' => 'Dpt Nontetap Laki',
			'dpt_nontetap_perm' => 'Dpt Nontetap Perm',
			'dpt_jml_laki' => 'Dpt Jml Laki',
			'dpt_jml_perm' => 'Dpt Jml Perm',
			'dpt_tahun' => 'Dpt Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('dpt_id',$this->dpt_id);
		$criteria->compare('dpt_pt',$this->dpt_pt,true);
		$criteria->compare('dpt_tetap_laki',$this->dpt_tetap_laki);
		$criteria->compare('dpt_tetap_perm',$this->dpt_tetap_perm);
		$criteria->compare('dpt_nontetap_laki',$this->dpt_nontetap_laki);
		$criteria->compare('dpt_nontetap_perm',$this->dpt_nontetap_perm);
		$criteria->compare('dpt_jml_laki',$this->dpt_jml_laki);
		$criteria->compare('dpt_jml_perm',$this->dpt_jml_perm);
		$criteria->compare('dpt_tahun',$this->dpt_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}